#ifndef KMY_SCENE_INTERFACE_H
#define KMY_SCENE_INTERFACE_H

#include "KmyTypedef.h"
#include "KmyICanvas.h"

#include "Node/KmyNode.h"
#include "Node/KmyNodeLayer.h"
#include "Node/KmyWorld.h"

#include <map>
using namespace std;

/**
  * 原ScreenInterface
  * SceneLogo， SceneTitle， SceneGame等的基类，管理所有逻辑
  */

class KmySceneManager;

class KmyIScene
{
public:
    KmyIScene();
    KmyIScene(KmySceneManager* manager,
              int screen_count,
              KmyICanvas** screens);
    virtual ~KmyIScene();

    KmySceneManager *scene_manager;

//    void removeNode(int id);

//    virtual void addUI(KmyNode* ui, int screen_no = 0); // 添加图也用这个方法
//    virtual void removeUI(KmyNode* ui);

//    virtual void addSpriteUI(KmySprite *spt, int screen_no = 0);
//    virtual void addSpriteWorld(KmySprite *spt, int map_index=0, int screen_no=0);
//    virtual void removeSprite(KmySprite *spt);
//    virtual void removeSprite(int spt_id);

//    void addMap(KmyMap *map);
//    void removeMap(int map_id);

    KmyNodeLayer* getUILayer(int screen_no);
    KmyWorld* getWorld(int screen_no);

    void registNode(KmyNode* node);
    KmyNode* getNode(int id);
    void removeNode(int id);
    void removeNode(KmyNode* node);

    virtual void initialize() = 0;
    virtual void finalize();
    virtual void logic();
    virtual void render();

protected:
    int screen_count;
    KmyICanvas** screens;
    KmyNodeLayer    **ui_layers;
    KmyWorld        **world_layers;

    map<int, KmyNode*> node_map;

};

#endif // KMY_SCENE_INTERFACE_H
